Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added --iflabel argument to be able to change the perfdata label name… #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dhoffend
Copy link
Contributor

@dhoffend dhoffend commented Nov 4, 2016

In most cases when using png4nagios and the long interface description names (like GigabitEthernet1/0/1...) the label was barely readable or truncated in the default configuration.

This pull request adds the optional feature to use a different interface name-style (example the short syntax) as perfdata labels. In some situations it can also be useful to add the interface description (aka alias) that can be shown in the final generated graph to make it easier to read for non-tech-people.

Normal/Default Perfdata Label

# ./check_nwc_health --community xxx --hostname xxx --mode interface-usage --name GigabitEthernet1/0/1
OK - interface GigabitEthernet1/0/1 (alias uplink) usage is in:0.00% (633.92bit/s) out:0.00% (1687.57bit/s) | 'GigabitEthernet1/0/1_usage_in'=0.00%;80;90;0;100 'GigabitEthernet1/0/1_usage_out'=0.00%;80;90;0;100 'GigabitEthernet1/0/1_traffic_in'=633.92;800000000;900000000;0;1000000000 'GigabitEthernet1/0/1_traffic_out'=1687.57;800000000;900000000;0;1000000000

Short Perfdata Label

# ./check_nwc_health --community xxx --hostname xxx --mode interface-usage --name GigabitEthernet1/0/1 --iflabel ifName
OK - interface GigabitEthernet1/0/1 (alias uplink) usage is in:0.00% (703.75bit/s) out:0.00% (11293.88bit/s) | 'Gi1/0/1_usage_in'=0.00%;80;90;0;100 'Gi1/0/1_usage_out'=0.00%;80;90;0;100 'Gi1/0/1_traffic_in'=703.75;800000000;900000000;0;1000000000 'Gi1/0/1_traffic_out'=11293.88;800000000;900000000;0;1000000000

Short + Interface Description Label

# ./check_nwc_health --community xxx --hostname xxx --mode interface-usage --name GigabitEthernet1/0/1 --iflabel ifName,ifAlias
OK - interface GigabitEthernet1/0/1 (alias uplink) usage is in:0.00% (613.08bit/s) out:0.00% (1416.52bit/s) | 'Gi1/0/1_uplink_usage_in'=0.00%;80;90;0;100 'Gi1/0/1_uplink_usage_out'=0.00%;80;90;0;100 'Gi1/0/1_uplink_traffic_in'=613.08;800000000;900000000;0;1000000000 'Gi1/0/1_uplink_traffic_out'=1416.52;800000000;900000000;0;1000000000

Tested and verified. Please tell me your thoughts.

@dhoffend
Copy link
Contributor Author

dhoffend commented Nov 4, 2016

Added one more example using the interface-health mode that shows all possible labels

./check_nwc_health --community xxx --hostname xxx --mode interface-health --name GigabitEthernet1/0/1 --iflabel ifName
OK - GigabitEthernet1/0/1 (alias uplink) is up/up, interface GigabitEthernet1/0/1 (alias uplink) usage is in:0.00% (437.33bit/s) out:0.00% (1040.00bit/s), interface GigabitEthernet1/0/1 (alias uplink) errors in:0.00/s out:0.00/s , interface GigabitEthernet1/0/1 (alias uplink) discards in:0.00/s out:0.00/s  | 'Gi1/0/1_usage_in'=0.00%;80;90;0;100 'Gi1/0/1_usage_out'=0.00%;80;90;0;100 'Gi1/0/1_traffic_in'=437.33;800000000;900000000;0;1000000000 'Gi1/0/1_traffic_out'=1040;800000000;900000000;0;1000000000 'Gi1/0/1_errors_in'=0;1;10;; 'Gi1/0/1_errors_out'=0;1;10;; 'Gi1/0/1_discards_in'=0;1;10;; 'Gi1/0/1_discards_out'=0;1;10;;

@dhoffend dhoffend changed the title added --iflabel argument to be ably to change the perfdata label name… added --iflabel argument to be able to change the perfdata label name… Nov 4, 2016
@dhoffend
Copy link
Contributor Author

dhoffend commented Nov 7, 2016

I've found 1 problem. The usage of "_" as limiter between iflabel parts can confuse the existing pnp4nagios template which removes everything after "_" to build the interface part in the rrd graph title.

A possible solution could be to update the existing pnp4nagios contrib file to only remove the /_(traffic|usage)_(in|out)$/ part instead of /_.*$/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant